
import request from '../../utils/request';
//data：post请求中携带的数据（obj格式），params：get请求中携带的数据（就是在浏览器地址xx/xx/xx后面?XX=oo&XX=oo这部分数据，obj格式）
//管理员登陆
export default{
    listUser: query => {
        return request({
            url: '/pet-admin/system/user/listPage',
            method: 'post',
            data: query
        });
    },

    getUser: query => {
        return request({
            url: '/pet-admin/system/user/detail',
            method: 'post',
            data: query
        });
    },
    
    addUser: query => {
        return request({
            url: '/pet-admin/system/user/add',
            method: 'post',
            data: query
        });
    },

    updateUser: query => {
        return request({
            url: '/pet-admin/system/user/edit',
            method: 'post',
            data: query
        });
    },
    
    resetUserPwd: query => {
        return request({
            url: '/pet-admin/system/user/edit/pwd',
            method: 'post',
            data: query
        });
    },

    getAuthRole: query => {
        return request({
            url: '/pet-admin/system/role/list',
            method: 'post',
            data: query
        });
    },

    updateAuthRole: query => {
        return request({
            url: '/pet-admin/system/user/edit/role',
            method: 'post',
            data: query
        });
    },
    
    delUser: query => {
        return request({
            url: '/pet-admin/system/user/delete',
            method: 'post',
            data: query
        });
    },

    changeUserStatus: query => {
        return request({
            url: '/pet-admin/system/user/edit/status',
            method: 'post',
            data: query
        });
    },

    updateUserProfile: query => {
        return request({
            url: '/pet-admin/system/user/edit/self/info',
            method: 'post',
            data: query
        });
    },

    updateUserPwd: query => {
        return request({
            url: '/pet-admin/system/user/edit/self/pwd',
            method: 'post',
            data: query
        });
    },

    getRoleList: query => {
        return request({
            url: '/pet-admin/system/role/list',
            method: 'post',
            data: query
        });
    },

    getPostList: query => {
        return request({
            url: '/pet-admin/system/post/list',
            method: 'post',
            data: query
        });
    },
}
